package cn.com.nes.site.entity.vo.workOrder;

import cn.com.nes.site.entity.bo.workorder.DistributeWorkOrderInstallBO;
import cn.com.nes.site.entity.em.WorkOrderEmergencyDegreeEnum;
import cn.com.nes.site.entity.vo.BaseVO;
import cn.hutool.core.util.StrUtil;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 工单信息保存入参模型
 */
@Data
public class DistributeWorkOrderInstallVO extends BaseVO {

    /**
     * 项目ID
     */
    @NotNull(message = "项目ID")
    private Long projectId;

    /**
     * 客户ID
     */
    @NotNull(message = "客户ID")
    private String customerId;

    /**
     * 安装人员ID
     */
    @NotNull(message = "安装人员ID")
    private String maintainId;

    /**
     * 销售订单ID
     */
    @NotNull(message = "销售订单ID")
    private Long saleOrderId;

    /**
     * 系统单id
     */
    @NotNull(message = "系统单id")
    private Long priceMasterId;

    /**
     * 约定上门时间-开始
     */
    @NotNull(message = "约定上门时间-开始")
    private Date agreedDoorstepTimeStart;

    /**
     * 约定上门时间-结束
     */
    @NotNull(message = "约定上门时间-结束")
    private Date agreedDoorstepTimeEnd;

    /**
     * 紧急程度ID
     */
    private Integer emergencyDegreeId = Integer.valueOf(WorkOrderEmergencyDegreeEnum._2.getKey());

    /**
     * 安装地址
     */
    private String address = StrUtil.EMPTY;


    public DistributeWorkOrderInstallBO convertToBo() {
        DistributeWorkOrderInstallBO bo = new DistributeWorkOrderInstallBO();
        BeanUtils.copyProperties(this, bo);
        return bo;
    }
}
